goog.provide('lfpug.events.ModelChangeEvent');
goog.require('goog.events');
goog.require('goog.events.Event');



/**
 * @constructor
 * @param {!string} type The event type.
 * @param {!lfpug.model.BaseModel} data The associated model..
 * @param {Array.<goog.events.Event>=} opt_chain The bubble chain.
 * @param {Object=} opt_target the optional event target. See parent class docs.
 * @extends {goog.events.Event}
 */
lfpug.events.ModelChangeEvent = function(type, data, opt_chain, 
    opt_target) {
  goog.events.Event.call(this, type, opt_target);
  this.data_ = data;
  if (goog.isDefAndNotNull(opt_chain) && goog.isArray(opt_chain)) {
    this.chain_ = opt_chain;
  } else {
    this.chain_ = [];
  }
};
goog.inherits(lfpug.events.ModelChangeEvent, goog.events.Event);


/**
 * @private
 */
lfpug.events.ModelChangeEvent.prototype.chain_;


/**
 * @private
 * @type {!lfpug.model.BaseModel}
 */
lfpug.events.ModelChangeEvent.prototype.data_;


/**
 * @param {lfpug.model.BaseModel.ChangedProperty} props The data
 *  stored by this event.
 */
lfpug.events.ModelChangeEvent.prototype.setChangedProp = function(props) {
  this.changedProp_ = props;
};


/**
 * @return {lfpug.model.BaseModel.ChangedProperty} props The data
 *  stored by this event.
 */
lfpug.events.ModelChangeEvent.prototype.getChangedProp = function() {
  return this.changedProp_;
};


/**
 * @return {!lfpug.model.BaseModel} The data stored by this event.
 */
lfpug.events.ModelChangeEvent.prototype.getData = function() {
  return this.data_;
};


/**
 * @return {Array.<goog.events.Event>} the chain of events which
 * got us to this point.
 */
lfpug.events.ModelChangeEvent.prototype.getChain = function() {
  return this.chain_;
};
